<script lang="ts" setup>
import axios from 'axios'
import { IResponse, TChannelArr } from '../types/index'
import { Ref, ref } from 'vue';

// const channelList = ref<TChannelArr>([])
const channelList: Ref<TChannelArr> = ref([])

const getList = async () => {
  const r = await axios.get<IResponse<{ channels: TChannelArr }>>('http://geek.itheima.net/v1_0/channels')
  channelList.value = r.data.data.channels
}
getList()
</script>

<template>
  <ul class="catagtory">
    <li class="select" v-for="item in channelList" :key="item.id">{{item.name}}</li>
  </ul>
</template>

<style scoed lang="less"></style>
